package com.lili.greedy;

/**
 * @Auther: 李 力
 * @Date: 2024/8/6
 * @Description: 物品类->ScoreAndBeiBao
 * @version: 1.0
 */
public class Item {
    //编号
    private int index;
    //重量
    private int weight;
    //价值
    private int value;

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public Item(int index, int weight, int value, String name) {
        this.index = index;
        this.weight = weight;
        this.value = value;
        this.name = name;
    }

    //名称
    private String name;

    public int getIndex() {
        return index;
    }

    public void setIndex(int index) {
        this.index = index;
    }

    public int getWeight() {
        return weight;
    }

    public void setWeight(int weight) {
        this.weight = weight;
    }

    public int getValue() {
        return value;
    }

    public void setValue(int value) {
        this.value = value;
    }

    public Item(int index, int weight, int value) {
        this.index = index;
        this.weight = weight;
        this.value = value;
    }

    //计算单位价值
    public int getUnitValue() {
        return value / weight;
    }

}
